<?php

if(!$_SESSION) session_start();
// Connect to the database
////////////////////////////////////////////////////////

require_once("../scripts/config.php");

// Load Functions
////////////////////////////////////////////////////////

require_once("../scripts/functions.php");

// Insert Task
////////////////////////////////////////////////////////

if(isset($_POST) && ($_POST['set_post']==1)){

	$set_active = "0";

	if($_POST['set_active']=="yes") $set_active = 1;

	$sql = sprintf("INSERT INTO tblprojects (project_label,set_active,UserID) VALUES (%s, %s, %s)",
					GetSQLValueString($_POST['project_label'], "text"),
					GetSQLValueString($set_active, "int"),
					GetSQLValueString($_SESSION['UserID'], "int"));

	sqlMod($sql, $db);

        echo $sql;

	exit("Project Created Successfully!");

}

?>
<form action="/forms/user_new.php" method="post" id="formANU">
<table>
<tr><td>Email:</td><td><input type="text" name="email_address " id="email_address " /></td></tr>
<tr><td>Password:</td><td><input type="text" name="password" id="password" /></td></tr>
<tr><td>Name:</td><td><input type="text" name="name_display" id="name_display" /></td></tr>
</table>

		<p>Permissions:</p>
		<p>
                        <label><input type="checkbox" name="set_active" id="set_active" value="1" />
                        Active</label><br/>
                        <label><input type="checkbox" name="set_project_add" id="set_project_add" value="1" />
                        Add Projects
                        </label><br/>
                        <label><input type="checkbox" name="set_project_edit" id="set_project_edit" value="1" />
                        Edit Projects</label><br/>
                        <label><input type="checkbox" name="set_user_add" id="set_user_add" value="1" />
                        Add Users</label><br/>
                        <label><input type="checkbox" name="set_user_edit" id="set_user_edit" value="1" />
                        Edit Users</label><br/>
                        <label><input type="checkbox" name="set_task_add" id="set_task_add" value="1" />
                        Add Tasks</label><br/>

                        <label><input type="checkbox" name="set_task_edit_subject" id="set_task_edit_subject" value="1" />
                        Edit Task Subject</label><br/>
                        <label><input type="checkbox" name="set_task_edit_due" id="set_task_edit_due" value="1" />
                        Edit Task Due Date</label><br/>
                        <label><input type="checkbox" name="set_task_edit_status" id="set_task_edit_status" value="1" />
                        Edit Task Status</label><br/>
                        <label><input type="checkbox" name="set_task_edit_priority" id="set_task_edit_priority" value="1" />
                        Edit Task Priority</label><br/>
                        <label><input type="checkbox" name="set_task_edit_progress" id="set_task_edit_progress" value="1" />
                        Edit Task Progress</label><br/>
                        <label><input type="checkbox" name="set_task_edit_project" id="set_task_edit_project" value="1" />
                        Edit Task Details</label><br/>

                        <label><input type="checkbox" name="set_task_edit_type" id="set_task_edit_type" value="1" />
                        Edit Task Type</label><br/>
                        <label><input type="checkbox" name="set_task_edit_assigned" id="set_task_edit_assigned" value="1" />
                        Edit Task Assignment</label><br/>
                        <label><input type="checkbox" name="set_task_edit_details" id="set_task_edit_details" value="1" />
                        Edit Task</label><br/>
                        <label><input type="checkbox" name="set_note_add" id="set_note_add" value="1" />
                        Add Update Note</label><br/>
                        <label><input type="checkbox" name="set_send_reminder" id="set_send_reminder" value="1" />
                        Receive Email Reminders</label><br/>
                        <label><input type="checkbox" name="set_admin" id="set_admin" value="1" />
                        Administrator</label>
		</p>
                <input name="set_post" type="hidden" id="set_post" value="1" />
</form>
